//
//  Utils.h
//  MemberProject
//
//  Created by MAC OS X on 15/4/3.
//  Copyright (c) 2015年 MAC OS X. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CommonCrypto/CommonDigest.h>
#import "AFHTTPRequestOperation.h"
@interface Utils : NSObject

+ (BOOL) validateIdCard:(NSString *)idCard;//匹配身份证
+ (BOOL) validateMobile:(NSString *)mobile;//匹配电话号码
+ (BOOL) validateEmail:(NSString *)email;//匹配邮箱
+(BOOL)validataDate:(NSString *)date;//匹配日期

+(NSString *)changeDateFromService:(NSString*)dateStr;//切换日期 由yyyyMMdd 换成yyyy-MM-dd
+(NSString *)changeDayDateFromService:(NSString*)dateStr;//切换日期 由yyyyMMdd HHmmss换yyyy-MM-dd
+(NSString *)changeDateToService:(NSString *)dateStr;//切换日期  由yyyy-MM-dd 换成yyyyMMdd

+(NSString *)md5:(NSString *)str;
+ (BOOL)isCurrentDay:(NSDate *)aDate;//判断是否为今天

+ (BOOL)date:(NSDate*)date isBetweenDate:(NSDate*)beginDate andDate:(NSDate*)endDate;

+ (BOOL)checkClaimDate:(NSString*)dateStr isBetweenDate:(NSString*)beginDateStr andDate:(NSString*)endDateStr;

+(AFHTTPRequestOperation *)requestDic:(NSDictionary *)parameters andRusult:(CSResultBlock)result andError:(CSResultBlock)errorResult;
+(void)showAlert:(NSString *)str;
+(CGFloat)heightForTextView:(NSString *)content andFont:(CGFloat)font andWidth:(CGFloat)width;

+(CGFloat)heightForLabel:(NSString *)content andFont:(CGFloat)font andWidth:(CGFloat)width;
@end
